package com.stop.activity.fragment;

import android.app.ActionBar;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.app.ActionBar.Tab;
import android.os.Bundle;

public class SalaTabListener implements	ActionBar.TabListener {

	private Fragment mFragment;
	private Activity mActivity;
	private String fragName;
	private Bundle params;

	public SalaTabListener(Activity activity, String fragName, Bundle params) {
		this.mActivity = activity;
		this.fragName = fragName;
		this.params = params;
	}

	public void onTabSelected(Tab tab, FragmentTransaction ft) {
		mFragment = Fragment.instantiate(mActivity, fragName, params);
		ft.add(android.R.id.content, mFragment);
	}

	public void onTabUnselected(Tab tab, FragmentTransaction ft) {
		ft.detach(mFragment);
		mFragment = null;
	}

	public void onTabReselected(Tab tab, FragmentTransaction ft) {

	}
}
